/**
 * DiggApiNet - Digg API .NET Wrapper
 * 
 * Author: Sean Hickey
 * Link: http://www.headzoo.com/digg_api_net
 * License: GPL v2 ( http://www.gnu.org/licenses/gpl.txt )
 */
using System;
using System.Collections;
using System.Text;
using System.Web;

namespace DiggApiNet
{
    public partial class DiggApi
    {
        public class ListTopics : DiggApi
        {
            private const string get_all            = "http://services.digg.com/topics/{0}";
            private const string get_by_short_name  = "http://services.digg.com/topic/{0}/{1}";
            
            public DiggTopics GetAll()
            {
                return GetAll(new Hashtable());
            }
            public DiggTopics GetAll(Hashtable args)
            {
                string uri = String.Format(get_all, HttpBuildUrl(args));
                return new DiggTopics(Request(uri));
            }

            public DiggTopic GetByShortName(string short_name)
            {
                return GetByShortName(short_name, new Hashtable());
            }
            public DiggTopic GetByShortName(string short_name, Hashtable args)
            {
                short_name = HttpUtility.UrlEncode(short_name);
                string uri = String.Format(get_by_short_name, short_name, HttpBuildUrl(args));
                return new DiggTopic(Request(uri));
            }
        }
    }
}
